package de.java.swing.extension.ui;

import java.awt.FlowLayout;

import javax.swing.BorderFactory;

/**
 * TODO Kommentar.
 * 
 * @author Patrick Haas
 * @since 1.0.0
 * 
 */
public class Toolbar extends ExtendedPanel {

	private static final long serialVersionUID = 3116670697613207471L;

	public static ExtendedPanel createSeperator(int width) {
		ExtendedPanel extendedPanel = new ExtendedPanel();
		extendedPanel.setBorder(BorderFactory.createEmptyBorder(0, width / 2, 0, width / 2));
		return extendedPanel;
	}

	public Toolbar() {
		this(FlowLayout.LEFT);
	}

	public Toolbar(int alignment) {
		super(1.0f);
		this.setLayout(new FlowLayout(alignment, 3, 0));
		this.setBackground(ExtendedWindow.DEFAULT_DECORATION_COLOR);
	}

	public void addItem(ToolbarItem item) {
		this.add(item);
	}

}
